Operators

Generic operators

class qtealeaves.operators.TNOperators(set_names='default', mapping_func=None)[source]

Generic class to write operators. This class contains no pre-defined operators. It allows you to start from scratch if no other operator class fulfills your needs.

Arguments

set_nameslist of str, optional

Name of the operators sets. Default to default

mapping_funccallable (or None), optional

Mapping the site index to an operator. Arguments site_idx must be accepted. Default to None (default mapping to only operator set)

Extract the local links from the operators.

Arguments

num_sitesinteger

Number of sites.

paramsdict

Dictionary with parameterization of the simulation.

get_operator(site_idx_1d, operator_name, params)[source]

Provide a method to return any operator, either defined via a callable or directly as a matrix.

Arguments

site_idx_1dint, str

If int, site where we need the operator. Mapping will evaluate what to return. If str, name of operator set.

operator_namestr

Tag/identifier of the operator.

paramsdict

Simulation parameters as a dictionary; dict is passed to callable.

items()[source]

Iterate throught all (key, value) pairs of all operators sets.

keys()[source]

Return the keys of the underlying dictionary.

property mapping_func

Mapping function for site to operator set name.

property one_unique

Flag if only one operators set exists (True) or multiple (False).

property set_names

Return operator set names as list of strings.

transform(transformation, **kwargs)[source]

Generate a new TNOperators by transforming the current instance.

Arguments

transformationcallable

Accepting key and value as arguments plus potential keyword arguments.

**kwargskey-word arguments

Will be passed to transformation

write_input(folder_name, params, tensor_backend, required_operators)[source]

Write the input for each operator.

Arguments

folder_namestr

Folder name with all the input files; will be extended by the subfolder with the operators.

paramsdict

Dictionary with the simulation parameters.

tensor_backendinteger

The integer flag indicates if AbelianSymTensors or Tensors should be written to the input files.

required_operatorslist

List of operators keys which is needed for AbelianSymTensors, where we distinguish between left, right, center, and independent operators.

write_operator(folder_dst, operator_name, params, tensor_backend, **kwargs)[source]

Write operator to file. Format depends on the tensor backend.

Arguments

folder_dststr or filehandle

If filehandle, write there. If string, it defines the folder.

operator_namestr

Name of the operator.

paramsdictionary

Contains the simulation parameters.

kwargs : passed to write_symtensor

write_operator_abeliansym(folder_dst, operator_name, params, **kwargs)[source]

Write an abelian symmetry tensor based on the parameter dictionary, which has to provide the definitions of the symmetry, i.e., generators and symmetry type.

Arguments

see write_operator

write_operator_dense(folder_dst, operator_name, params)[source]

Write dense tensor based on the numpy array.

Arguments

see write_operator

Spin 1/2 operators

class qtealeaves.operators.TNSpin12Operators[source]

Operators specifically targeted at spin 1/2 systems. The operators id, sx, sz, n``= 1/2*(1-``sz), and nz = 1/2*(1+``sz``) are provided by default.

Arguments

folder_operatorsstr, optional

The name of the subfolder inside the input folder, where we store operators. Default to SPIN12

Qudit operators

class qtealeaves.operators.TN3levelsOperators[source]

Operators defined for Lambda-like three-level systems, e.g., used in the case of Rydberg systems.

Arguments

folder_operatorsstr, optional

The name of the subfolder inside the input folder, where we store operators. Default to 3levels

Details

The three levels are labeled as: |0>, |1> and |r>. The following operators are defined: n0, n1, nr, sx01, sy01, sz01, n01, n10, n1r, nr1, sx1r. The identity id is defined as well.

class qtealeaves.operators.TN4levelsOperators[source]

Operators defined for a 4-level system, e.g., targeting Rydberg systems with two low-energy states, one Rydberg state |r>, and one additional state |d> allowing a decay from |r> to |d>.

Arguments

folder_operatorsstr, optional

The name of the subfolder inside the input folder, where we store operators. Default to 4levels

Details

The following operators are defined: n0, n1, nr, nd, sx01, and sx1r. The identity id is defined as well.

Bosonic operators

class qtealeaves.operators.TNBosonicOperators[source]

Operators specifically targeted at bosonic systems. The operators id, b, bdagger, n, and nint are provided by default.

Arguments

folder_operatorsstr

The name of the subfolder inside the input folder, where we store operators.

Details

The truncation of the Fock-space can be set via the keys fock_space_nmin and fock_space_nmax. By default, the local dimension is four including the levels 0, 1, 2, and 3.

static get_b(params)[source]

Define the bosonic annihilation operator.

static get_bdagger(params)[source]

Define the bosonic creation operator.

static get_id(params)[source]

Define the identity operator.

static get_n(params)[source]

Define the number operator.

static get_nint(params)[source]

Define the on-site interaction operator 0.5 * n * (n - 1).

Combined operators

class qtealeaves.operators.TNCombinedOperators(ops_a, ops_b)[source]

Combine operators for system a and b.

Arguments

ops_ainstance of TNOperators

Set of operators for system a.

ops_binstance of TNOperators

Set of operators for system b.

folder_operatorsstr, optional

The name of the subfolder inside the input folder, where we store operators. Default to CombinedOps

Details

The key of the operators after merging will be ops_a.ops_b.

get_any_operator_function(key_a, key_b)[source]

Get function to compute kronecker product between set of operators a and b.

Parameters

key_astr

Operator name of class a.

key_bstr

Operator name of class b.

merge_ops()[source]

Merge set of operators.